<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">

<head>

    <th:block th:include="MainInterface/include :: common-css" />

</head>

<body class="fixed-left">
<div id="wrapper">
    <th:block th:include="MainInterface/include :: header-menu(4)" />
    <div class="dialog">
        <form id="bookList">
            <div class="dialog-box">
            <h2>添加出版社</h2>
            <div>
                <p>
                   ID :
                    <input  name="id" th:value="${publisherlist.id}" readonly unselectable="on">
                </p>
                <p>
                    出版社 : <input name="name" th:value="${publisherlist.name}">
                </p>
            </div>
                <div>
            <input style="width: 75px ; height : 50px " type="button" id="book_save" onclick="edit()" naem="修改" value="修改">
<!--            <button onclick="edit()">修改</button>-->
            <button style="width: 75px ; height : 50px "><a href="/publisher">返回</a></button></div>
            </div>
        </form>
    </div>
    </div>
    <th:block th:include="MainInterface/include :: foter" />
    <th:block th:include="MainInterface/include :: common-js" />
</body>
<script>
    function edit(){
        $.ajax({
            type:"post",
            url:"/publishe/saveOrUpdata",
            data:$("#bookList").serialize(),
            async:true,
            dataType: 'json',
            success:function (result) {
                console.log(11111111)
                // console.log($("#bookList").serialize(),)
                if(result.code==0){
                    window.alert("修改成功");
                    window.location.href="/publisher"
                } else {
                    window.alert(result.msg || "修改失败");
                }

            }
        });
    }

</script>
<style>
    a:link{
        color: black;
        text-decoration: none;
    }
    a:visited {
        text-decoration: none;
        color: black;
    }
    a:hover {
        text-decoration: none;
        color: black;
    }
    a:active {
        text-decoration: none;
        color: black;
    }

</style>
</html>